<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%
	request.setCharacterEncoding("UTF-8");
	String htmlData = request.getParameter("content1") != null ? request.getParameter("content1") : "";
%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/makeupPage.jsp"%>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/argeeCommon.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/againstAuditCommon.jsp" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="<%=path%>/My97DatePicker/WdatePicker.js"></script>
<link rel="stylesheet" type="text/css" href="<%=path%>/CSS/backLayout.css">
<link rel="stylesheet" type="text/css" href="<%=path%>/CSS/bombBox.css">
</head>
<style>
select{width: 234px;height: 31px}
.gn_name{padding-top: 5px}

.div_zilei {
    width: 94.5%;
    height: 30px
}
.tr{height:40px;background: #57a0ff;font-weight:700;}
.tr td{font-size: 14px;color:#ffffff}
.tr_td{height: 40px;}
.tr_td td{border-bottom: 1px solid #ededed;text-align: center;}
tr td:nth-child(1) {font-size: 14px;color: #000000}
.date{border: 0;background: #ffffff;text-align: center;}
.tr_td td:nth-child(1){border-left: 1px solid #cccccc;}
.tr_td td:nth-child(3){border-right: 1px solid #cccccc;}
.addTable.deleteTable:HOVER{cursor:pointer;}
type[type='checkbox']{width: 15px}
#table1 input{width: 150px}
#table2 input{width: 150px;}
#table3 input{width: 150px;}
.fseq2{border: none;color: #cccccc;text-align: center;}	
 .loading {
            margin: 100px 450px;
            display: block;
            width: 65px;
            height: 65px;
            border: 1px solid #ddd;
            border-radius: 5px;
            opacity: .7;
            background: url(../images/loading.gif) no-repeat;
        }
</style>
<body style="background: #f5f5f5">
<div class="main">
<div id="modal-overlay">
			    
			</div>
		<c:if test="${empty sh}">
			<div class="weizhi">
				财务管理>>补考收费>>修改
			</div>
		</c:if>
		<c:if test="${sh == '5'}">
			<div class="weizhi">
				财务管理>>补考收费>>查看
			</div>
		</c:if>
	<div class="div_body" style="box-shadow: 0 0 5px #cccccc;height: 950px">
			<div class="div_form">
			<!------------------------------------- 修改 ----------------------------------->
			<c:if test="${empty sh}">
				<form action="<%=path%>/DrivingSys/modifyMakeupCharge" class="form" method="post"
					  onsubmit="return verify();">
						<div class="div_input_hang">
							<div class="input_hang">
								<span class="gn_name">驾校&nbsp;:&nbsp;</span>
								<input  type="text" name="name" class="jx" value="${department.fnameL2}" readonly="readonly" style="color: gray;"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">单据编号&nbsp;:&nbsp;</span>
								<input  type="text" name="fnumber" value="${makeupCharge.fnumber}" style="color: gray;" readonly="readonly"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">业务日期&nbsp;:&nbsp;</span>
								<input  type="text" name="fbizdate"  id="ywrq" value="${makeupCharge.fbizdate}" 
								onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})"/>
								<img onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})" 
					            src="<%=path%>/image/date.jpg"  align="absmiddle" style="padding-left: 15px">
							</div>
						</div>
						<div class="div_input_hang">
							<div class="input_hang">
								<span class="gn_name">摘要&nbsp;:&nbsp;</span>
								<input name="fdescription" value="${makeupCharge.fdescription}"/>
								<input type="hidden" name="fid" value="${makeupCharge.fid}" class="fid">
							</div>
							<div class="input_hang">
								<span class="gn_name">单据状态&nbsp;:&nbsp;</span>
								<select name="cfbillstate" disabled="disabled">
									<option style="color: gray;">保存</option>
								</select>
							</div>
							<div class="input_hang">
								<span class="gn_name">科目&nbsp;:&nbsp;</span>
								<select class="kemu" name="cfkemu">
								<c:if test="${makeupCharge.cfkemu == '1'}">
									<option value="1">科目一</option>
									<option value="2">科目二</option>
									<option value="3">科目三</option>
								</c:if>
								<c:if test="${makeupCharge.cfkemu == '2'}">
									<option value="2">科目二</option>
									<option value="1">科目一</option>
									<option value="3">科目三</option>
								</c:if>
								<c:if test="${makeupCharge.cfkemu == '3'}">
									<option value="3">科目三</option>
									<option value="2">科目二</option>
									<option value="1">科目一</option>
								</c:if>
								</select>
							</div> 
					</div>
					
					<div class="div_zilei">
							<div style="width: 93%;text-align: right;">
								<img src="<%=path%>/image/insert2323.jpg" class="addTable">
								<span style="padding-right: 20px;color: #57a0ff;font-weight:700;;font-size: 14px" class="addTable">添加</span>
								<img src="<%=path%>/image/delete212.png" class="deleteTable">
								<span class="deleteTable" style="color: #57a0ff;font-weight:700;;font-size: 14px" class="deleteTable">删除</span>
							</div>
					</div>
					<input type="hidden" class="stu">
					<input type="hidden" id="auditState" value="${AuditState}">
					<div style="min-height: 500px;width: 88%;padding-left: 90px;position: relative;">
					<div style="overflow:scroll;height: 500px;width: 100%"> 
							<table  width="100%" align="center" id="table1" style="min-height:50px;border-spacing:0;">
									<tr class="tr">
										<td  width="20px"></td>
										<td  width="30px"></td>
										<td align="center">学员</td>
										<td align="center">学员编码</td>
										<td align="center">身份证号</td>
										<td align="center">身份证地址</td>
										<td align="center">申请车型</td>
										<td align="center">学员状态</td>
										<td align="center">考试次数</td>
										<td align="center">缺考次数</td>
										<td align="center">应收金额</td>
										<td align="center">现金</td>
										<td align="center">刷卡</td>
										<td align="center">实收金额</td>
										<td align="center">摘要</td>
									</tr>
									<c:forEach items="${makeupChargeEntrys}" var="makeupChargeEntrys" varStatus="s">
									<tr class="xy${makeupChargeEntrys.fseq}" style="margin-top: 45px">
									<td width="20px"><input type="checkbox" name="check" style="width: 15px"></td>
										<td>
											<input type="text" name="fseq2" class="fseq2" value="${makeupChargeEntrys.fseq}" readonly="readonly" style="width:40px">
											<input type="hidden" name="fseq" class="fseq" value="${makeupChargeEntrys.fseq}">
										</td>
                                        <td><input type="text" class="studentName is_click_ne"
                                                   value="${makeupChargeEntrys.studentName}"
                                                   onclick="selSrtdent($(this))" name="studentName"></td>
      									<td>
       										<input type="text" class="cfstudentno" name="cfstudentno" value="${makeupChargeEntrys.cfstudentno}" readonly="readonly">
       										<input type="hidden" name="cfstudentid" value="${makeupChargeEntrys.cfstudentid}">
       									</td>
				                		<td><input type="text" class="cfidcardno" name="cfidcardno" value="${makeupChargeEntrys.cfidcardno}" readonly="readonly"></td>
				                		<td><input type="text" class="cfidcardaddress" name="cfidcardaddress" value="${makeupChargeEntrys.cfidcardaddress}" readonly="readonly"></td>
				                		<td><input type="text" class="cfsqcx" name="cfsqcx" value="${makeupChargeEntrys.cfsqcx}" readonly="readonly"></td>
				                		<c:if test="${makeupChargeEntrys.cfstate == '3'}">
				                		<td>
				                			<input type="text" readonly="readonly" name="cfstate2" value="未通过科目一" class="cfstate">
				                			<input type="hidden" name="cfstate" value="3">
				                		</td>
				                		</c:if>
				                		<c:if test="${makeupChargeEntrys.cfstate == '5'}">
				                		<td>
				                			<input type="text" readonly="readonly" name="cfstate2" value="科目二未通过,科目三未开始" class="cfstate">
				                			<input type="hidden" name="cfstate" value="5">
										</td>
				                		</c:if>
				                		<c:if test="${makeupChargeEntrys.cfstate == '6'}">
				                		<td>
				                			<input type="text" readonly="readonly" name="cfstate2" value="科目二练车中,科目三未开始" class="cfstate">
				                			<input type="hidden" name="cfstate" value="6">
				                		</td>
				                		</c:if>
				                		<c:if test="${makeupChargeEntrys.cfstate == '8'}">
				                		<td>
				                			<input type="text" readonly="readonly" name="cfstate2" value="科目三未通过,科目二通过" class="cfstate">
				                			<input type="hidden" name="cfstate" value="8">
				                		</td>
				                		</c:if>
				                		<c:if test="${makeupChargeEntrys.cfstate == '9'}">
				                		<td>
				                			<input type="text" readonly="readonly" name="cfstate2" value="科目三练车中,科目二通过" class="cfstate">
				                			<input type="hidden" name="cfstate" value="9">
				                		</td>
				                		</c:if>
				                		<c:if test="${makeupChargeEntrys.cfstate == '17'}">
				                		<td>
				                			<input type="text" readonly="readonly" name="cfstate2" value="科目三通过,科目二未通过" class="cfstate">
				                			<input type="hidden" name="cfstate" value="17">
				                		</td>
				                		</c:if>
				                		<c:if test="${makeupChargeEntrys.cfstate == '18'}">
				                		<td>
				                			<input type="text" readonly="readonly" name="cfstate2" value="科目三通过,科目二练车中" class="cfstate">
				                			<input type="hidden" name="cfstate" value="18">
				                		</td>
				                		</c:if>
				                		<c:if test="${makeupChargeEntrys.cfstate == '15'}">
				                		<td>
				                			<input type="text" readonly="readonly" name="cfstate2" value="科目三练车中,科目二未通过" class="cfstate">
				                			<input type="hidden" name="cfstate" value="15">
				                		</td>
				                		</c:if>
				                		<c:if test="${makeupChargeEntrys.cfstate == '16'}">
				                		<td>
				                			<input type="text" readonly="readonly" name="cfstate2" value="科目三练车中,科目二未开始" class="cfstate">
				                			<input type="hidden" name="cfstate" value="16">
				                		</td>
				                		</c:if>
				                		<c:if test="${makeupChargeEntrys.cfstate == '20'}">
				                		<td>
				                			<input type="text" readonly="readonly" name="cfstate2" value="科目二未通过,科目三未通过" class="cfstate">
				                			<input type="hidden" name="cfstate" value="20">
				                		</td>
				                		</c:if>
				                		<c:if test="${makeupChargeEntrys.cfstate == '21'}">
				                		<td>
				                			<input type="text" readonly="readonly" name="cfstate2" value="科目二未开始,科目三未通过" class="cfstate">
				                			<input type="hidden" name="cfstate" value="21">
				                		</td>
				                		</c:if>
										<c:if test="${makeupChargeEntrys.cfstate == '22'}">
											<td>
												<input type="text" readonly="readonly" name="cfstate2"
													   value="科目二练车中,科目三未通过" class="cfstate">
												<input type="hidden" name="cfstate" value="22">
											</td>
										</c:if>
										<td><input type="text" name="cfkscs" value="${makeupChargeEntrys.cfkscs}"
												   class="cfkscs" onblur="cfkscs2($(this))"></td>
										<td><input type="text" name="cfqkcs" class="cfqkcs"
												   value="${makeupChargeEntrys.cfqkcs}" onblur="cfqkcs2($(this))"></td>
				                		<td><input type="text" readonly="readonly" value="${makeupChargeEntrys.cfysje}" name="cfysje" class="cfysje"></td>
				                		<td>
				                			<input type="text" name="cfcash" onblur="cfcash2($(this))" class="cfcash" value="${makeupChargeEntrys.cfcash}">
				                			<input type="hidden" value="${makeupChargeEntrys.cfcash}">
				                		</td>
				                		<td>
				                			<input type="text" name="cfcard" onblur="cfcard2($(this))" class="cfcard" value="${makeupChargeEntrys.cfcard}">
				                			<input type="hidden" value="${makeupChargeEntrys.cfcard}">
				                		</td>
				                		<td><input type="text" name="cfsjje" readonly="readonly" class="cfsjje" value="${makeupChargeEntrys.cfsjje}"></td>
				                		<td><input type="text" name="cfremark" class="cfremark" value="${makeupChargeEntrys.cfremark}"></td>
									</tr>
									</c:forEach>
							</table>
								
							<table align="center" id="table2" style="height:50px;overflow:scroll;border-spacing:0;margin-top: 100px;">
								<tr>
										<td><input type="text" readonly="readonly" value="合计" class="" style="width: 45px;color: #cccccc;text-align: center;"></td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" value="0" readonly="readonly" id="ysje"></td>
										<td><input type="text" value="0" readonly="readonly" id="cfcash"></td>
										<td><input type="text" value="0" readonly="readonly" id="cfcard"></td>
										<td><input type="text" value="0" readonly="readonly" id="cfshje"><input type="hidden" value="0"></td>
										<td><input type="text" readonly="readonly"></td>
								</tr>
							</table>
						</div>
					</div>
					
					
					 <div class="div_input_hang" style="margin-top: 50px">
							<div class="input_hang">
								<span class="gn_name">审核人&nbsp;:&nbsp;</span>
								<input name="fhandlerid" readonly="readonly" style="color: gray;" type="text"
									   value="${makeupCharge.shName}"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">创建者&nbsp;:&nbsp;</span>
								<input name="fcreatorid2" readonly="readonly" value="${makeupCharge.createName}" style="color: gray;" type="text"/>
								<input name="fcreatorid" readonly="readonly"  style="color: gray;" type="hidden"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">创建时间&nbsp;:&nbsp;</span>
								<input name="fcreatetime" style="color: gray;" readonly="readonly" type="text" value="${makeupCharge.fcreatetime}"/>
							</div> 
					</div>

					<div class="div_tj" style="padding-top: 0px;width:80%">
						<shiro:hasPermission name="/queryMakeupByFid">
						<div>
							<input class="input_submit bc" value="" type="submit">
						</div>
						</shiro:hasPermission>
						<shiro:hasPermission name="/submitMakeupCharge">
							<div style="padding-right: 50px">
								<input type="button" class="input_submit tj" value="" id="submit"/>
							</div>
						</shiro:hasPermission>
						<div>
							<input type="button" class="input_back fh" value="" onclick="back()"/>
						</div>
					</div>
				</form>
				</c:if>
				
				<!------------------------------------- 查看 ----------------------------------->
				<c:if test="${sh == '5'}">
				<form  class="form">
						<div class="div_input_hang">
							<div class="input_hang">
								<span class="gn_name">驾校&nbsp;:&nbsp;</span>
								<input  type="text" name="name" class="jx" value="${department.fnameL2}" readonly="readonly" style="color: gray;"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">单据编号&nbsp;:&nbsp;</span>
								<input type="text" name="fnumber" id="fnumber" value="${makeupCharge.fnumber}"
									   style="color: gray;" readonly="readonly"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">业务日期&nbsp;:&nbsp;</span>
								<input  type="text" name="fbizdate"  id="ywrq" value="${makeupCharge.fbizdate}"  readonly="readonly"/>
								<img  src="<%=path%>/image/date.jpg"   style="padding-left: 15px">
							</div>
						</div>
						<div class="div_input_hang">
							<div class="input_hang">
								<span class="gn_name">摘要&nbsp;:&nbsp;</span>
								<input name="fdescription" value="${makeupCharge.fdescription}" readonly="readonly"/>
								<input type="hidden" name="fid" value="${makeupCharge.fid}" class="fid">
							</div>
							<div class="input_hang">
								<span class="gn_name">单据状态&nbsp;:&nbsp;</span>
								<select name="cfbillstate" disabled="disabled">
									<c:if test="${makeupCharge.cfbillstate == 4}">
										<option style="color: gray;">提交</option>
									</c:if>
									<c:if test="${makeupCharge.cfbillstate == 5}">
										<option style="color: gray;">审核</option>
									</c:if>
								</select>
							</div>
							<div class="input_hang">
								<span class="gn_name">科目&nbsp;:&nbsp;</span>
								<select class="kemu" name="cfkemu" disabled="disabled">
								<c:if test="${makeupCharge.cfkemu == '1'}">
									<option value="1">科目一</option>
									<option value="2">科目二</option>
									<option value="3">科目三</option>
								</c:if>
								<c:if test="${makeupCharge.cfkemu == '2'}">
									<option value="2">科目二</option>
									<option value="1">科目一</option>
									<option value="3">科目三</option>
								</c:if>
								<c:if test="${makeupCharge.cfkemu == '3'}">
									<option value="3">科目三</option>
									<option value="2">科目二</option>
									<option value="1">科目一</option>
								</c:if>
								</select>
							</div> 
					</div>
					
					<div class="div_zilei">
							<div style="width: 88%;text-align: right;">
									<%--<img src="<%=path%>/image/insert2323.jpg" class="addTable">
                                    <span style="padding-right: 20px;color: #a9bbe0;font-size: 14px">添加</span>
                                    <img src="<%=path%>/image/delete212.png" class="deleteTable">
                                    <span class="deleteTable" style="color: #a9bbe0;font-size: 14px">删除</span>--%>
							</div>
					</div>
					<input type="hidden" class="stu">
					<input type="hidden" id="state" value="${makeupCharge.cfbillstate}">
					<input type="hidden" class="type">
					<div style="min-height: 500px;width: 88%;padding-left: 90px;position: relative;">
					<div style="overflow:scroll;height: 500px;width: 100%"> 
							<table  width="100%" align="center" id="table3" style="min-height:50px;border-spacing:0;">
									<tr class="tr">
										<td  width="20px"></td>
										<td  width="30px"></td>
										<td align="center">学员</td>
										<td align="center">学员编码</td>
										<td align="center">身份证号</td>
										<td align="center">身份证地址</td>
										<td align="center">申请车型</td>
										<td align="center">学员状态</td>
										<td align="center">考试次数</td>
										<td align="center">缺考次数</td>
										<td align="center">应收金额</td>
										<td align="center">现金</td>
										<td align="center">刷卡</td>
										<td align="center">实收金额</td>
										<td align="center">摘要</td>
									</tr>
									<c:forEach items="${makeupChargeEntrys}" var="makeupChargeEntrys">
									<tr>
										<td width="20px"><input type="checkbox" name="check" style="width: 15px" disabled="disabled"></td>
										<td>
											<input type="text" name="fseq" class="fseq" value="${makeupChargeEntrys.fseq}" readonly="readonly" style="width:40px">
										</td>
										<td><input type="text" class="studentName" value="${makeupChargeEntrys.studentName}" readonly="readonly"></td>
      									<td>
       										<input type="text" class="cfstudentno" name="cfstudentno" value="${makeupChargeEntrys.cfstudentno}" readonly="readonly">
       										<input type="hidden" name="cfstudentid" value="${makeupChargeEntrys.cfstudentid}">
       									</td>
				                		<td><input type="text" class="cfidcardno" name="cfidcardno" value="${makeupChargeEntrys.cfidcardno}" readonly="readonly"></td>
				                		<td><input type="text" class="cfidcardaddress" name="cfidcardaddress" value="${makeupChargeEntrys.cfidcardaddress}" readonly="readonly"></td>
				                		<td><input type="text" class="cfsqcx" name="cfsqcx" value="${makeupChargeEntrys.cfsqcx}" readonly="readonly"></td>
				                		<c:if test="${makeupChargeEntrys.cfstate == '3'}">
				                		<td>
				                			<input type="text" readonly="readonly" name="cfstate2" value="未通过科目一" class="cfstate">
				                			<input type="hidden" name="cfstate" value="3">
				                		</td>
				                		</c:if>
				                		<c:if test="${makeupChargeEntrys.cfstate == '5'}">
				                		<td>
				                			<input type="text" readonly="readonly" name="cfstate2" value="科目二未通过,科目三未开始" class="cfstate">
				                			<input type="hidden" name="cfstate" value="5">
										</td>
				                		</c:if>
				                		<c:if test="${makeupChargeEntrys.cfstate == '6'}">
				                		<td>
				                			<input type="text" readonly="readonly" name="cfstate2" value="科目二练车中,科目三未开始" class="cfstate">
				                			<input type="hidden" name="cfstate" value="6">
				                		</td>
				                		</c:if>
				                		<c:if test="${makeupChargeEntrys.cfstate == '8'}">
				                		<td>
				                			<input type="text" readonly="readonly" name="cfstate2" value="科目三未通过,科目二通过" class="cfstate">
				                			<input type="hidden" name="cfstate" value="8">
				                		</td>
				                		</c:if>
				                		<c:if test="${makeupChargeEntrys.cfstate == '9'}">
				                		<td>
				                			<input type="text" readonly="readonly" name="cfstate2" value="科目三练车中,科目二通过" class="cfstate">
				                			<input type="hidden" name="cfstate" value="9">
				                		</td>
				                		</c:if>
				                		<c:if test="${makeupChargeEntrys.cfstate == '17'}">
				                		<td>
				                			<input type="text" readonly="readonly" name="cfstate2" value="科目三通过,科目二未通过" class="cfstate">
				                			<input type="hidden" name="cfstate" value="17">
				                		</td>
				                		</c:if>
				                		<c:if test="${makeupChargeEntrys.cfstate == '18'}">
				                		<td>
				                			<input type="text" readonly="readonly" name="cfstate2" value="科目三通过,科目二练车中" class="cfstate">
				                			<input type="hidden" name="cfstate" value="18">
				                		</td>
				                		</c:if>
				                		<c:if test="${makeupChargeEntrys.cfstate == '15'}">
				                		<td>
				                			<input type="text" readonly="readonly" name="cfstate2" value="科目三练车中,科目二未通过" class="cfstate">
				                			<input type="hidden" name="cfstate" value="15">
				                		</td>
				                		</c:if>
				                		<c:if test="${makeupChargeEntrys.cfstate == '16'}">
				                		<td>
				                			<input type="text" readonly="readonly" name="cfstate2" value="科目三练车中,科目二未开始" class="cfstate">
				                			<input type="hidden" name="cfstate" value="16">
				                		</td>
				                		</c:if>
				                		<c:if test="${makeupChargeEntrys.cfstate == '20'}">
				                		<td>
				                			<input type="text" readonly="readonly" name="cfstate2" value="科目二未通过,科目三练车中" class="cfstate">
				                			<input type="hidden" name="cfstate" value="20">
				                		</td>
				                		</c:if>
				                		<c:if test="${makeupChargeEntrys.cfstate == '21'}">
				                		<td>
				                			<input type="text" readonly="readonly" name="cfstate2" value="科目二未开始,科目三未通过" class="cfstate">
				                			<input type="hidden" name="cfstate" value="21">
				                		</td>
				                		</c:if>
										<c:if test="${makeupChargeEntrys.cfstate == '22'}">
											<td>
												<input type="text" readonly="readonly" name="cfstate2"
													   value="科目二练车中,科目三未通过" class="cfstate">
												<input type="hidden" name="cfstate" value="22">
											</td>
										</c:if>
				                		<td><input type="text" name="cfkscs" value="${makeupChargeEntrys.cfkscs}" class="cfkscs" readonly="readonly"></td>
				                		<td><input type="text" name="cfqkcs" class="cfqkcs" value="${makeupChargeEntrys.cfqkcs}" readonly="readonly"></td>
				                		<td><input type="text" readonly="readonly" value="${makeupChargeEntrys.cfysje}" name="cfysje" class="cfysje"></td>
				                		<td>
				                			<input type="text" name="cfcash" readonly="readonly" class="cfcash" value="${makeupChargeEntrys.cfcash}">
				                			<input type="hidden" value="${makeupChargeEntrys.cfcash}">
				                		</td>
				                		<td>
				                			<input type="text" name="cfcard" readonly="readonly" class="cfcard" value="${makeupChargeEntrys.cfcard}">
				                			<input type="hidden" value="${makeupChargeEntrys.cfcard}">
				                		</td>
				                		<td><input type="text" name="cfsjje" readonly="readonly" class="cfsjje" value="${makeupChargeEntrys.cfsjje}"></td>
				                		<td><input type="text" name="cfremark" class="cfremark" value="${makeupChargeEntrys.cfremark}" readonly="readonly"></td>
									</tr>
									</c:forEach>
							</table>
								
							<table align="center" id="table2" style="height:50px;overflow:scroll;border-spacing:0;margin-top: 100px;">
								<tr>
										<td><input type="text" readonly="readonly" value="合计" class="" style="width: 45px;color: #cccccc;text-align: center;"></td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" value="0" readonly="readonly" id="ysje"></td>
										<td><input type="text" value="0" readonly="readonly" id="cfcash"></td>
										<td><input type="text" value="0" readonly="readonly" id="cfcard"></td>
										<td><input type="text" value="0" readonly="readonly" id="cfshje"><input type="hidden" value="0"></td>
										<td><input type="text" readonly="readonly"></td>
								</tr>
							</table>
						</div>
					</div>
					
					
					 <div class="div_input_hang" style="margin-top: 50px">
							<div class="input_hang">
								<span class="gn_name">审核人&nbsp;:&nbsp;</span>
								<input name="fhandlerid" readonly="readonly" style="color: gray;" type="text"  value="${makeupCharge.shName}"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">创建者&nbsp;:&nbsp;</span>
								<input name="fcreatorid2" readonly="readonly" value="${makeupCharge.createName}" style="color: gray;" type="text"/>
								<input name="fcreatorid" readonly="readonly"  style="color: gray;" type="hidden"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">创建时间&nbsp;:&nbsp;</span>
								<input name="fcreatetime" style="color: gray;" readonly="readonly" type="text" value="${makeupCharge.fcreatetime}"/>
							</div> 
					</div> 
					
					<div class="div_tj">
						<c:if test="${AuditState == 'true'}">
							<shiro:hasPermission name="/auditMakeupCharge">
								<div style="padding-right: 50px">
									<input type="button" class="input_submit sh" value="" id="sh"/>
									<input type="hidden" value="1">
								</div>
							</shiro:hasPermission>
						</c:if>
						<shiro:hasPermission name="/againstAuditMakeupCharge">
							<div style="padding-right: 50px">
								<input type="button" class="input_submit fsh" value="" id="fsh">
								<input type="hidden" value="2">
							</div>
						</shiro:hasPermission>
						<div>
							<input type="button" class="input_submit cklc" value=""
								   onclick="lookActivitiImg('${key}',$('#fnumber').val())"/>
						</div>
						<div>
							<input type="button" class="input_back fh" value="" onclick="back()"/>
						</div>
				</div>
				</form>
				</c:if>
			</div>
	</div>
</div>
</body>
<script type="text/javascript" src="<%=path%>/JQuery/jquery-1.8.2.js"></script>
<%@ include file="/WEB-INF/JSP/ajax.jsp"%>
<script type="text/javascript" src="<%=path%>/HoganJS/handlebars-v4.0.11.js"></script>
<script type="text/javascript">
//删除一行
$(".deleteTable").click(function(){
	var tr_len = $("#table1 tr").length;
	if(tr_len == 1){
		
	}else{
		var s = '';
		$('input:checkbox[name=check]').each(function(i) {
			if($(this).is(':checked')){
                //减去应收金额
                var guifei = $(this).parent().parent().find(".cfysje").val()
                var card = ($("#ysje").val() * 1) - (guifei * 1)
                //保留2位小数点
                card = decimal(card, 2);
                $("#ysje").val(card)

                //减去现金
                var cfcash = $(this).parent().parent().find(".cfcash").val()
                if (cfcash == '' || cfcash == null) {

                } else {
                    var cash = ($("#cfcash").val() * 1) - (cfcash * 1)
                    //保留2位小数点
                    cash = decimal(cash, 2);
                    $("#cfcash").val(cash)
                }

                //减去刷卡
                var cfcard = $(this).parent().parent().find(".cfcard").val()
                if (cfcard == '' || cfcard == null) {

                } else {
                    var card = ($("#cfcard").val() * 1) - (cfcard * 1)
                    //保留2位小数点
                    card = decimal(card, 2);
                    $("#cfcard").val(card)
                }

                //减去实收金额
                var cfshje = $(this).parent().parent().find(".cfsjje").val()
                if (cfshje == '' || cfshje == null) {

                } else {
                    var cfshje2 = ($("#cfshje").val() * 1) - (cfshje * 1);
                    //保留2位小数点
                    cfshje2 = decimal(cfshje2, 2);
                    $("#cfshje").val(cfshje2)
                }
                $(this).parent().parent().remove();
                s = '1';
            }
        })
	if($("#table1 tr").length == 1){
		$("#table2").css('display','none')
	}
	//判断是否选中
	if(s == null || s == ''){
		alert("请选择一条数据删除");
		return false;
	}
	//重新排序
	$('#table1 tr td .fseq').each(function(i) {
		var s = i*1 + 1*1;
		$(this).val(s);
		$(this).prev().val(s)
		$(this).parent().parent().attr("class",'xy'+s);
	})
}
})
//返回
function back(){
    parent.closeSelectCard()

    //location = '<%=path%>/DrivingSys/queryMakeupCharge/look.action';
}

//开启弹框
$('.addTable').click(function(){
	var kemu = $(".kemu").val();
	$.ajax({
		  url: '<%=path%>/DrivingSys/queryStuByPsql',
		  data:{'kemu':kemu},
          type: "post",
          dataType: "json",
          success:function(json){
        	  data(json)
        	 $(".loading").hide();
          },
          error: function () {
              alert('Error');
          }
	})
	$('#modal-overlay').css('visibility','visible')
	$('.modal-data').css('visibility','visible')
	$('.xysj input:checkbox').removeAttr('checked');
})

 //点击查找按钮
 $('.findBtn1').click(function () {
	 	var kemu = $(".kemu").val();
        myname = $('.name1').val();
        cflxdh = $('.cflxdh').val();
        $.ajax({
            url: '<%=path%>/DrivingSys/queryStuByPsql',
            data:{'name':myname,'tel':cflxdh,'kemu':kemu},
            type: "post",
            dataType: "json",
            success: function (json) {
            	data(json)
            },
            error: function () {
                alert('Error');
            }
        });

  })


 $(".cfcash,.cfcard").live('keyup', function(event) {
	//最后一位是小数点的话，移除
		var $amountInput = $(this);
		//响应鼠标事件，允许左右方向键移动 
		event = window.event || event;
		if(event.keyCode == 37 | event.keyCode == 39) {
			return;
		}
		var clazz = $(this).prop("class")
     //获取父类class名称
     var superclass = $(this).parent().parent().prop("class")
		//获取输入框的值
		var value = $('.'+clazz+'').val();
		//判断负数是否在第一位
		 if(value.substring(0,1) == '-'){
			
		 }
		//判断负数不是在第一位，替换
		 if(value.lastIndexOf('-') > 0){
             $('.superclass .' + clazz + '').val("")
			// $amountInput.val($amountInput.val().replace('-','')
		 }
		//先把非数字的都替换掉，除了数字和. 
		$amountInput.val($amountInput.val().replace(/[^\-?\d.]/g, "").
		//只允许一个小数点              
		replace(/^\./g, "").replace(/\.{2,}/g, ".").
		//只能输入小数点后两位
		replace(".", "$#$").replace(/\./g, "").replace("$#$", ".").replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'));
});

	$(".cfkscs,.cfqkcs").live('keyup', function(event){//当键盘按下之后立即校验，并替换当前操作框中的内容 
		$(this).val($(this).val().replace(/\D|^0/g,''));  
	});

/* 关闭弹出框    */
$('.btn').click(function(){
	$('#modal-overlay').css('visibility','hidden')
	$('.modal-data').css('visibility','hidden')
	$(".stu").val("")
})

function data(json){
	var str = ''
		for (var i = 0; i < json.length; i++) {
			str += '<tr style="margin-top: 45px;height: 30px;" class="xysj"><td class="td"><input style="width: 15px;height: 15px" '
  	         str+='type="checkbox" name="train"  value="'+json[i].fid+'"></td>'
	  	   	if (json[i].fnameL2 == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].fnameL2 + '</td>'
			}
			if (json[i].fnumber == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].fnumber + '</td>'
			}
			if (json[i].cfidcardno == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfidcardno + '</td>'
			}
			if (json[i].cfrxsj == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfrxsj + '</td>'
			}
			if (json[i].cfsjhm == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfsjhm + '</td>'
			}
			str += '<td>'+$(".jx").val()+'</td>'
			if (json[i].cfslzjcxdh == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfslzjcxdh + '</td>'
			}
			if (json[i].cfclazzName == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfclazzName + '</td>'
			}
			if (json[i].cfamount == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfamount + '</td>'
			}
			if(json[i].cfstudentstate == '3'){
				str+=' <td>科目一未通过</td>';
			}else if(json[i].cfstudentstate == '5'){
				str+='<td>科目二未通过,科目三未开始</td>';
			}else if(json[i].cfstudentstate == '6'){
				str+='<td>科目二练车中,科目三未开始</td>';
			}else if(json[i].cfstudentstate == '8'){
				str+='<td>科目三未通过,科目二通过</td>';
			}else if(json[i].cfstudentstate == '9'){
				str+='<td>科目三练车中,科目二通过</td>';
			}else if(json[i].cfstudentstate == '17'){
				str+='<td>科目三通过,科目二未通过</td>';
			}else if(json[i].cfstudentstate == '18'){
				str+='<td>科目三通过,科目二练车中</td>';
			}else if(json[i].cfstudentstate == '15'){
				str+='<td>科目三练车中,科目二未通过</td>';
			}else if(json[i].cfstudentstate == '16'){
				str+='<td>科目三练车中,科目二未开始</td>';
			}else if(json[i].cfstudentstate == '20'){
				str+='<td>科目二未通过,科目三未通过</td>';
            } else if (json[i].cfstudentstate == '21') {
				str +='<td>科目二未开始,科目三未通过</td>'
            } else {
                str += '<td>科目二练车中,科目三未通过</td>'
			}
			if (json[i].cfreceived == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfreceived + '</td>'
			}
			if (json[i].cffavorable == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cffavorable + '</td>'
			}
			if (json[i].cfarrearage == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfarrearage + '</td>'
			}
			if (json[i].cfkmykss == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfkmykss + '</td>'
			}
			if (json[i].cfkmekss == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfkmekss + '</td>'
			}
			if (json[i].cfkmskss == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfkmskss + '</td>'
			}
			if (json[i].cfkmyherq == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfkmyherq + '</td>'
			}
			if (json[i].cfkmehgrq == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfkmehgrq + '</td>'
			}
			if (json[i].cfkmshgrq == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfkmshgrq + '</td>'
			}
			if (json[i].cfkmybjgsj == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfkmybjgsj + '</td>'
			}
			if (json[i].cfkmebjgsj == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfkmebjgsj + '</td>'
			}
			if (json[i].cfkmsbjgsj == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfkmsbjgsj + '</td>'
			}
			str += '</tr>';
			$(".head2 tr:not(':first')").remove()
			$('.head2').append(str)
		}
}

//选择数据
 $('.subtn').click(function () {
	 var spCodesTemp = "";
	 var fseq = $(".stu").val();
	 if(fseq == '' || fseq == null){
		 $('input:checkbox[name=train]:checked').each(function (i) {
	         if (0 == i) {
	             //把学生id增加到字表中
	             spCodesTemp = $(this).val();
	
	         } else {
	             spCodesTemp += ("," + $(this).val());
	
	         }
	     });
		 if(spCodesTemp == ""){
			 alert("请至少选择一条数据")
			 return false
		 }
         var a = studentRepetition(null, spCodesTemp)
         if (!a) {
             alert("不能添加重复学员");
             return;
         }

     $.ajax({
          url: '<%=path%>/DrivingSys/selStudentByFid',
          type: "post",
          async: true,
          data: {'id': spCodesTemp},
          dataType: "json",
          success: function (json) {
        	  		 var studentsNameList = json.studentsNameList;
        	  		studentData(fseq,studentsNameList);
          },
          error:function(){alert("错误")}
       })
	 }else{
			 $('input:checkbox[name=train]:checked').each(function(i) {
		         if (0 == i) {
		             //把学生id增加到字表中
		             spCodesTemp = $(this).val();
		         } 
			 })
			 if(spCodesTemp == null){
	        	 alert("请选择一条数据")
	        	 return false
	         }
         var a = studentRepetition(spCodesTemp, null)
         if (!a) {
             alert("不能添加重复学员");
             return;
         }
	         $.ajax({
		          url: '<%=path%>/DrivingSys/selStudentByFid',
		          type: "post",
		          async: true,
		          data: {'id': spCodesTemp},
		          dataType: "json",
		          success:function(json){
		        	  var studentsNameList = json.studentsNameList;
		        	  studentData(fseq,studentsNameList);
		          },
		          error:function(){alert("错误")}
     		});
	        
	 	}
 });
 
 function studentData(fseq,studentsNameList){
	 //补考费
 	 var bkf = 0;
	 var tr_len = $("#table1 tr").length;//表格长度
	 if(fseq == '' || fseq == null){
		 var str;
		 for(var i=0;i<studentsNameList.length;i++) {
	            str+='<tr style="margin-top: 45px" class=xy'+(tr_len+i)+'>'
	            str+='<td width="20px"><input type="checkbox" name="check" style="width: 15px"></td>'
	           	str+='<td><input type="text" readonly unselectable="on" class="fseq2" value='+(tr_len+i)+' style="width: 40px"><input type="hidden" name="fseq" class="fseq" value='+(tr_len+i)+'></td>'
	            if(studentsNameList[i].fnameL2 == null){
                    str += '<td><input type="text" onclick="selSrtdent($(this))" class="studentName is_click_ne"/></td>'
	            }else{
                    str += '<td><input type="text" value=' + studentsNameList[i].fnameL2 + ' onclick="selSrtdent($(this))" class="studentName is_click_ne" name="studentName"/></td>'
	            }
	            if(studentsNameList[i].fnumber == null){
	            	str+='<td class="zjzdName"><input type="text" readonly unselectable="on" name="cfstudentno" class="cfstudentno"/><input type="hidden" name="cfstudentid" value='+studentsNameList[i].fid+'></td>'	
	            }else{
	     	    	str+='<td class="zjzdName"><input type="text" value='+studentsNameList[i].fnumber+' readonly unselectable="on" class="cfstudentno" name="cfstudentno" /><input type="hidden" name="cfstudentid" value='+studentsNameList[i].fid+'></td>'
	            }
	            if(studentsNameList[i].cfidcardno == null){
	            	str+='<td><input type="text" readonly unselectable="on" name="cfidcardno" class="cfidcardno"/></td>'	
	            }else{
	     	    	str+='<td><input type="text" readonly unselectable="on" value='+studentsNameList[i].cfidcardno+' name="cfidcardno" class="cfidcardno"/></td>'
	            }
	            if(studentsNameList[i].cflinkaddress == null){
	            	str+='<td><input type="text" readonly unselectable="on" name="cfidcardaddress" class="cflinkaddress"/></td>'	
	            }else{
	     	    	str+='<td><input type="text" readonly unselectable="on" value='+studentsNameList[i].cflinkaddress+' name="cfidcardaddress" class="cflinkaddress"/></td>'
	            }
	            if(studentsNameList[i].cfslzjcxdh == null){
	            	str+='<td><input type="text" readonly unselectable="on" name="cfsqcx" class="cfsqcx"/></td>'	
	            }else{
	     	    	str+='<td><input type="text" readonly unselectable="on" value='+studentsNameList[i].cfslzjcxdh+' name="cfsqcx" class="cfsqcx"/></td>'
	            }
	            if(studentsNameList[i].cfstudentstate == '3'){
	            	str+='<td><input type="text" readonly unselectable="on" name="cfstate2" value="未通过科目一" class="cfstate"/><input type="hidden" name="cfstate" value="3"></td>'	
	            	str+='<td><input type="text" name="cfkscs" value='+studentsNameList[i].cfkmykss+' class="cfkscs"></td>'	
	            	if(studentsNameList[i].cfkmyqkcs == null){
	            		str+='<td><input type="text" name="cfqkcs" class="cfqkcs"></td>'
	            	}else{
	            		str+='<td><input type="text" name="cfqkcs" value='+studentsNameList[i].cfkmyqkcs+' class="cfqkcs"></td>'
	            	}
	            }else if(studentsNameList[i].cfstudentstate == '5'){
	            	str+='<td><input type="text" readonly unselectable="on" name="cfstate2" value="科目二未通过,科目三未开始" class="cfstate2"/><input type="hidden" name="cfstate" value="5"></td>'
	            	str+='<td><input type="text" name="cfkscs" value='+studentsNameList[i].cfkmekss+' class="cfkscs"></td>'
	            	if(studentsNameList[i].cfkmeqkcs == null){
	            		str+='<td><input type="text" name="cfqkcs" class="cfqkcs"></td>'
	            	}else{
	            		str+='<td><input type="text" name="cfqkcs" value='+studentsNameList[i].cfkmeqkcs+' class="cfqkcs"></td>'
	            	}
	            }else if(studentsNameList[i].cfstudentstate == '6'){
	            	str+='<td><input type="text" readonly unselectable="on" name="cfstate2" value="科目二练车中,科目三未开始" class="cfstate2"/><input type="hidden" name="cfstate" value="6"></td>'
                    str += '<td><input type="text"  name="cfkscs" value=' + studentsNameList[i].cfkmekss + ' class="cfkscs"></td>'
	            	if(studentsNameList[i].cfkmeqkcs == null){
	            		str+='<td><input type="text" name="cfqkcs" class="cfqkcs"></td>'
	            	}else{
	            		str+='<td><input type="text" name="cfqkcs" value='+studentsNameList[i].cfkmeqkcs+' class="cfqkcs"></td>'
	            	}
	            }else if(studentsNameList[i].cfstudentstate == '18'){
	            		str+='<td><input type="text" readonly unselectable="on" name="cfstate2" value="科目三通过,科目二练车中" class="cfstate2"/><input type="hidden" name="cfstate" value="18"></td>'
                    str += '<td><input type="text"  name="cfkscs" value=' + studentsNameList[i].cfkmekss + ' class="cfkscs"></td>'
		            	if(studentsNameList[i].cfkmeqkcs == null){
		            		str+='<td><input type="text" name="cfqkcs" class="cfqkcs"></td>'
		            	}else{
		            		str+='<td><input type="text" name="cfqkcs" value='+studentsNameList[i].cfkmeqkcs+' class="cfqkcs"></td>'
		            	}
		        }else if(studentsNameList[i].cfstudentstate == '8'){
	            	str+='<td><input type="text" readonly unselectable="on" name="cfstate2" value="科目三未通过,科目二通过" class="cfstate"/><input type="hidden" name="cfstate" value="8"></td>'
	            	str+='<td><input type="text"  name="cfkscs" value='+studentsNameList[i].cfkmskss+' class="cfkscs"></td>'
	            	if(studentsNameList[i].cfkmsqkcs == null){
	            		str+='<td><input type="text" name="cfqkcs" class="cfqkcs"></td>'
	            	}else{
	            		str+='<td><input type="text" name="cfqkcs" value='+studentsNameList[i].cfkmsqkcs+' class="cfqkcs"></td>'
	            	}
	            }else if(studentsNameList[i].cfstudentstate == '9'){
	            	str+='<td><input type="text" readonly unselectable="on" name="cfstate2" value="科目三练车中,科目二通过" class="cfstate"/><input type="hidden" name="cfstate" value="9"></td>'
	            	str+='<td><input type="text" name="cfkscs" value='+studentsNameList[i].cfkmskss+' class="cfkscs"></td>'
	            	if(studentsNameList[i].cfkmsqkcs == null){
	            		str+='<td><input type="text" name="cfqkcs" class="cfqkcs"></td>'
	            	}else{
	            		str+='<td><input type="text" name="cfqkcs" value='+studentsNameList[i].cfkmsqkcs+' class="cfqkcs"></td>'
	            	}
	            }else if(studentsNameList[i].cfstudentstate == '17'){
	            		str+='<td><input type="text" readonly unselectable="on" name="cfstate2" value="科目三通过,科目二未通过" class="cfstate"/><input type="hidden" name="cfstate" value="17"></td>'
                    str += '<td><input type="text"  name="cfkscs" value=' + studentsNameList[i].cfkmekss + ' class="cfkscs"></td>'
	    	            if(studentsNameList[i].cfkmeqkcs == null){
	    	            	str+='<td><input type="text" name="cfqkcs" class="cfqkcs"></td>'
	    	            }else{
	    	            	str+='<td><input type="text" name="cfqkcs" value='+studentsNameList[i].cfkmeqkcs+' class="cfqkcs"></td>'
	    	            }
	            }else if(studentsNameList[i].cfstudentstate == '18'){
	            		str+='<td><input type="text" readonly unselectable="on" name="cfstate2" value="科目三通过,科目二练车中" class="cfstate"/><input type="hidden" name="cfstate" value="18"></td>'
                    str += '<td><input type="text"  name="cfkscs" value=' + studentsNameList[i].cfkmekss + ' class="cfkscs"></td>'
	    	            if(studentsNameList[i].cfkmeqkcs == null){
	    	            	str+='<td><input type="text" name="cfqkcs" class="cfqkcs"></td>'
	    	            }else{
	    	            	str+='<td><input type="text" name="cfqkcs" value='+studentsNameList[i].cfkmeqkcs+' class="cfqkcs"></td>'
	    	            }
	            }else if(studentsNameList[i].cfstudentstate == '15'){
	            		str+='<td><input type="text" readonly unselectable="on" name="cfstate2" value="科目三练车中,科目二未通过" class="cfstate"/><input type="hidden" name="cfstate" value="15"></td>'
		            	str+='<td><input type="text" name="cfkscs" value='+studentsNameList[i].cfkmskss+' class="cfkscs"></td>'
		            	if(studentsNameList[i].cfkmsqkcs == null){
		            		str+='<td><input type="text" name="cfqkcs" class="cfqkcs"></td>'
		            	}else{
		            		str+='<td><input type="text" name="cfqkcs" value='+studentsNameList[i].cfkmsqkcs+' class="cfqkcs"></td>'
		            	}
	            }else if(studentsNameList[i].cfstudentstate == '16'){
	            		str+='<td><input type="text" readonly unselectable="on" name="cfstate2" value="科目三练车中,科目二未开始" class="cfstate"/><input type="hidden" name="cfstate" value="16"></td>'
		            	str+='<td><input type="text" name="cfkscs" value='+studentsNameList[i].cfkmskss+' class="cfkscs"></td>'
		            	if(studentsNameList[i].cfkmsqkcs == null){
		            		str+='<td><input type="text" name="cfqkcs" class="cfqkcs"></td>'
		            	}else{
		            		str+='<td><input type="text" name="cfqkcs" value='+studentsNameList[i].cfkmsqkcs+' class="cfqkcs"></td>'
		            	}
	            }else if(studentsNameList[i].cfstudentstate == '21'){
	            		str+='<td><input type="text" readonly unselectable="on" name="cfstate2" value="科目二未开始,科目三未通过" class="cfstate"/><input type="hidden" name="cfstate" value="21"></td>'
		            	str+='<td><input type="text" name="cfkscs" value='+studentsNameList[i].cfkmskss+' class="cfkscs"></td>'
		            	if(studentsNameList[i].cfkmsqkcs == null){
		            		str+='<td><input type="text" name="cfqkcs" class="cfqkcs"></td>'
		            	}else{
		            		str+='<td><input type="text" name="cfqkcs" value='+studentsNameList[i].cfkmsqkcs+' class="cfqkcs"></td>'
		            	}
                } else if (studentsNameList[i].cfstudentstate == '20') {
	            		str+='<td><input type="text" readonly unselectable="on" name="cfstate2" value="科目二未通过,科目三未通过" class="cfstate"/><input type="hidden" name="cfstate" value="20"></td>'
		            	str+='<td><input type="text" name="cfkscs" value='+studentsNameList[i].cfkmskss+' class="cfkscs"></td>'
		            	if(studentsNameList[i].cfkmsqkcs == null){
		            		str+='<td><input type="text" name="cfqkcs" class="cfqkcs"></td>'
		            	}else{
		            		str+='<td><input type="text" name="cfqkcs" value='+studentsNameList[i].cfkmsqkcs+' class="cfqkcs"></td>'
		            	}
                } else {
                    str += '<td><input type="text" readonly unselectable="on" name="cfstate2" value="科目二练车中,科目三未通过" class="cfstate"/><input type="hidden" name="cfstate" value="22"></td>'
                    str += '<td><input type="text" name="cfkscs" value=' + studentsNameList[i].cfkmskss + ' class="cfkscs"></td>'
                    if (studentsNameList[i].cfkmsqkcs == null) {
                        str += '<td><input type="text" name="cfqkcs" class="cfqkcs"></td>'
                    } else {
                        str += '<td><input type="text" name="cfqkcs" value=' + studentsNameList[i].cfkmsqkcs + ' class="cfqkcs"></td>'
                    }
                }
	             //补考缴费
	            var bukao = 0;
	             	
	             $.ajax({
	            	 url: '<%=path%>/DrivingSys/selMakeupChatge',
	                 type: "post",
	                 async: false,
	                 data: {'state': studentsNameList[i].cfstudentstate},
	                 dataType: "json",
	                 success:function(json){
	                	 bukao = json;
	                 },
	                 error: function () {
	                     alert('Error');
	                 }
	            }) 
	            bkf = bkf*1 + bukao*1
	            bkf = decimal(bkf,2);
	            str+='<td><input type="text" readonly unselectable="on" value='+bukao+' name="cfysje" class="cfysje"/></td>'
	            str+='<td><input type="text" name="cfcash" onblur="cfcash2($(this))" class="cfcash" /><input type="hidden" value="0"/></td>'
	            str+='<td><input type="text" name="cfcard" onblur="cfcard2($(this))" class="cfcard"/><input type="hidden" value="0"/></td>'
	            str+='<td><input type="text" name="cfsjje" readonly unselectable="on" class="cfsjje" value="0"/></td>'
	            str+='<td><input type="text" name="cfremark" class="cfremark"/></td>'
	     	}
		   var shje =  $("#ysje").val();
		   shje = shje*1 + bkf*1
		   shje = decimal(shje,2);
		   $("#ysje").val(shje)
		   $("#table2").show()
		   $(".stu").val("");
		   $("#table1").append(str)
	       $('#modal-overlay').css('visibility', 'hidden')
	       $('.modal-data').css('visibility', 'hidden')
         //添加事件
         $(".cfkscs").attr("onblur", "cfkscs2($(this))");
         $(".cfqkcs").attr("onblur", "cfqkcs2($(this))");
	 }else{
		  studentsNameList = studentsNameList[0]
    	  if(studentsNameList.fnameL2 == null){
    		  
    	  }else{
    	  	var sgeifei = $('.xy'+fseq+'').find(".studentName").val(studentsNameList.fnameL2);
    	  }
			 if(studentsNameList.fnumber == null){
				$('.xy'+fseq+'').find(".cfstudentno").next().val(studentsNameList.fid);
    	  }else{
    	  	$('.xy'+fseq+'').find(".cfstudentno").val(studentsNameList.fnumber);
    	  	$('.xy'+fseq+'').find(".cfstudentno").next().val(studentsNameList.fid);
    	  }
			  if(studentsNameList.cfidcardno == null){
    		  
    	  }else{
    	  	$('.xy'+fseq+'').find(".cfidcardno").val(studentsNameList.cfidcardno);
    	  }
			  if(studentsNameList.cflinkaddress == null){
    		  
    	  }else{
    	  	 $('.xy'+fseq+'').find(".cflinkaddress").val(studentsNameList.cflinkaddress);
    	  }
			  if(studentsNameList.cfslzjcxdh == null){
    		  
    	  }else{
    	  	 $('.xy'+fseq+'').find(".cfsqcx").val(studentsNameList.cfslzjcxdh);
    	  }
		 if(studentsNameList.cfstudentstate == '3'){
				  $('.xy'+fseq+'').find(".cfslzjcxdh").val("未通过科目一");
				  $('.xy'+fseq+'').find(".cfslzjcxdh").next().val("3");
				  $('.xy'+fseq+'').find(".cfkscs").val(studentsNameList.cfkmykss);
				 	if(studentsNameList.cfkmyqkcs == null){
				 		$('.xy'+fseq+'').find(".cfqkcs").val("");
            	}else{
            		$('.xy'+fseq+'').find(".cfqkcs").val(studentsNameList.cfkmyqkcs)
            	}
    	  }else if(studentsNameList.cfstudentstate == '5'){
    		  $('.xy'+fseq+'').find(".cfslzjcxdh").val("科目二未通过,科目三未开始");
    		  $('.xy'+fseq+'').find(".cfslzjcxdh").next().val("5");
    		  $('.xy'+fseq+'').find(".cfkscs").val(studentsNameList.cfkmykss);
    		   if(studentsNameList.cfkmeqkcs == null){
			 		$('.xy'+fseq+'').find(".cfqkcs").val("");
            	}else{
            		$('.xy'+fseq+'').find(".cfqkcs").val(studentsNameList.cfkmeqkcs)
            	}
    	  }else if(studentsNameList.cfstudentstate == '6'){
    		  $('.xy'+fseq+'').find(".cfslzjcxdh").val("科目二练车中,科目三未开始");
    		  $('.xy'+fseq+'').find(".cfslzjcxdh").next().val("6");
    		  $('.xy'+fseq+'').find(".cfkscs").val(studentsNameList.cfkmykss);
    		  if(studentsNameList.cfkmeqkcs == null){
			 		$('.xy'+fseq+'').find(".cfqkcs").val("");
            	}else{
            		$('.xy'+fseq+'').find(".cfqkcs").val(studentsNameList.cfkmeqkcs)
            	}
    	  }else if(studentsNameList.cfstudentstate == '8'){
    		  $('.xy'+fseq+'').find(".cfslzjcxdh").val("科目三未通过,科目二通过");
    		  $('.xy'+fseq+'').find(".cfslzjcxdh").next().val("8");
    		  $('.xy'+fseq+'').find(".cfkscs").val(studentsNameList.cfkmykss);
    		  if(studentsNameList.cfkmsqkcs == null){
			 		$('.xy'+fseq+'').find(".cfqkcs").val("");
            	}else{
            		$('.xy'+fseq+'').find(".cfqkcs").val(studentsNameList.cfkmsqkcs)
            	}
    	  }else if(studentsNameList.cfstudentstate == '9'){
    		  $('.xy'+fseq+'').find(".cfslzjcxdh").val("科目三练车中,科目二通过");
    		  $('.xy'+fseq+'').find(".cfslzjcxdh").next().val("9");
    		  $('.xy'+fseq+'').find(".cfkscs").val(studentsNameList.cfkmykss);
    		  if(studentsNameList.cfkmsqkcs == null){
			 		$('.xy'+fseq+'').find(".cfqkcs").val("");
            	}else{
            		$('.xy'+fseq+'').find(".cfqkcs").val(studentsNameList.cfkmsqkcs)
            	}
    	  }else if(studentsNameList.cfstudentstate == '17'){
    		  $('.xy'+fseq+'').find(".cfslzjcxdh").val("科目三通过,科目二未通过");
    		  $('.xy'+fseq+'').find(".cfslzjcxdh").next().val("17");
    		  $('.xy'+fseq+'').find(".cfkscs").val(studentsNameList.cfkmykss);
    		   if(studentsNameList.cfkmeqkcs == null){
			 		$('.xy'+fseq+'').find(".cfqkcs").val("");
            	}else{
            		$('.xy'+fseq+'').find(".cfqkcs").val(studentsNameList.cfkmeqkcs)
            	}
    	  }else if(studentsNameList.cfstudentstate == '18'){
    		  $('.xy'+fseq+'').find(".cfslzjcxdh").val("科目三通过,科目二练车中");
    		  $('.xy'+fseq+'').find(".cfslzjcxdh").next().val("18");
    		  $('.xy'+fseq+'').find(".cfkscs").val(studentsNameList.cfkmykss);
    		   if(studentsNameList.cfkmeqkcs == null){
			 		$('.xy'+fseq+'').find(".cfqkcs").val("");
            	}else{
            		$('.xy'+fseq+'').find(".cfqkcs").val(studentsNameList.cfkmeqkcs)
            	}
    	  }else if(studentsNameList.cfstudentstate == '15'){
    		  $('.xy'+fseq+'').find(".cfslzjcxdh").val("科目三练车中,科目二未通过");
    		  $('.xy'+fseq+'').find(".cfslzjcxdh").next().val("15");
    		  $('.xy'+fseq+'').find(".cfkscs").val(studentsNameList.cfkmykss);
    		  if(studentsNameList.cfkmsqkcs == null){
			 		$('.xy'+fseq+'').find(".cfqkcs").val("");
            	}else{
            		$('.xy'+fseq+'').find(".cfqkcs").val(studentsNameList.cfkmsqkcs)
            	}
    	  }else if(studentsNameList.cfstudentstate == '16'){
    		  $('.xy'+fseq+'').find(".cfslzjcxdh").val("科目三练车中,科目二未开始");
    		  $('.xy'+fseq+'').find(".cfslzjcxdh").next().val("16");
    		  $('.xy'+fseq+'').find(".cfkscs").val(studentsNameList.cfkmykss);
    		  if(studentsNameList.cfkmsqkcs == null){
			 		$('.xy'+fseq+'').find(".cfqkcs").val("");
            	}else{
            		$('.xy'+fseq+'').find(".cfqkcs").val(studentsNameList.cfkmsqkcs)
            	}
    	  }else if(studentsNameList.cfstudentstate == '20'){
    		  $('.xy'+fseq+'').find(".cfslzjcxdh").val("科目二未通过,科目三未通过");
    		  $('.xy'+fseq+'').find(".cfslzjcxdh").next().val("20");
    		  $('.xy'+fseq+'').find(".cfkscs").val(studentsNameList.cfkmykss);
    		  if(studentsNameList.cfkmsqkcs == null){
			 		$('.xy'+fseq+'').find(".cfqkcs").val("");
            	}else{
            		$('.xy'+fseq+'').find(".cfqkcs").val(studentsNameList.cfkmsqkcs)
            	}
         } else if (studentsNameList.cfstudentstate == '21') {
    		  $('.xy'+fseq+'').find(".cfslzjcxdh").val("科目二未开始,科目三未通过");
    		  $('.xy'+fseq+'').find(".cfslzjcxdh").next().val("21");
    		  $('.xy'+fseq+'').find(".cfkscs").val(studentsNameList.cfkmykss);
    		  if(studentsNameList.cfkmsqkcs == null){
			 		$('.xy'+fseq+'').find(".cfqkcs").val("");
            	}else{
            		$('.xy'+fseq+'').find(".cfqkcs").val(studentsNameList.cfkmsqkcs)
            	}
         } else {
             $('.xy' + fseq + '').find(".cfslzjcxdh").val("科目二练车中,科目三未通过");
             $('.xy' + fseq + '').find(".cfslzjcxdh").next().val("22");
             $('.xy' + fseq + '').find(".cfkscs").val(studentsNameList.cfkmykss);
             if (studentsNameList.cfkmsqkcs == null) {
                 $('.xy' + fseq + '').find(".cfqkcs").val("");
             } else {
                 $('.xy' + fseq + '').find(".cfqkcs").val(studentsNameList.cfkmsqkcs)
             }
         }
			 
			  //补考缴费
            var bukao = 0;
             	
             $.ajax({
            	 url: '<%=path%>/DrivingSys/selMakeupChatge',
                 type: "post",
                 async: false,
                 data: {'state': studentsNameList.cfstudentstate},
                 dataType: "json",
                 success:function(json){
                	 bukao = json;
                 },
                 error: function () {
                     alert('Error');
                 }
            }) 
            //计算应收金额
            var zongbk = $("#ysje").val();
            var bk = $('.xy'+fseq+'').find(".cfysje").val()
            zongbk = zongbk*1 - bk*1 + bukao*1;
            zongbk = decimal(zongbk,2);
            $("#ysje").val(zongbk);
            $('.xy'+fseq+'').find(".cfysje").val(bukao)
            $('#modal-overlay').css('visibility', 'hidden')
            $('.modal-data').css('visibility', 'hidden')
    	    $(".stu").val("");
	 }
 }
 
//双击确定
 $(document).on('dblclick','.xysj td',function(){
	    var fseq = $(".stu").val();
     var fid = $(this).parent().find("input:checkbox").val();
     var a = studentRepetition(fid, null)
     if (!a) {
         alert("不能添加重复学员");
         return;
     }
	 	 $.ajax({
	 		  url: '<%=path%>/DrivingSys/selStudentByFid',
	          type: "post",
	          async: true,
	          data: {'id': fid},
	          dataType: "json",
	          success:function(json){
	        	  studentData(fseq,json.studentsNameList)
	          },
	          error: function () {
	                alert('Error');
	            }
	 	})
 })
 
 //由于和input:checkbox冲突，在选择一次
 $("#table1 tr td input:checkbox").live('click',function(){
	 if($(this).is(':checked')){
	    	$(this).removeAttr("checked");
	    }else{
	    	$(this).attr("checked",":checked")
	    }
 })
  //单击选中
  $("#table1 tr td").live('click',function(){
    if($(this).parent().find("input:checkbox").is(':checked')){
    	$(this).parent().find("input:checkbox").removeAttr("checked");
    }else{
    	$(this).parent().find("input:checkbox").attr("checked",":checked")
    }
 })  
 
  //单击选中
    $(document).on('click','.xysj td:not(.td)',function(){
    	if($(this).parent().find("input:checkbox").is(':checked')){
    		$(this).parent().find("input:checkbox").removeAttr("checked");
    	}else{
    		$(this).parent().find("input:checkbox").attr("checked",":checked")
    	}
    }) 
 
 //现金计算
 function cfcash2 (_this) {
		//避免最后一个字符串是.
	 	_this.val((_this.val().replace(/\.$/g, "")));
	 	if(_this.val() == '-'){
			_this.val("")
		}
     //判断输入错误
     if (isNaN(Number(_this.val()))) {
         _this.val("")
     }
		 //现金
		 var money = _this.val()
		 if(money == ''){
			 money = 0;
		 }
		 //存放之前的值
		 var zq =  _this.next().val();
		 _this.next().val(money);
		 //实收金额
		 var ssje = _this.parent().next().next().find(".cfsjje").val();
		 //计算实收金额
		 var jine = (ssje*1)-(zq*1)+(money*1);
		 //保留2位小数点
		 jine = decimal(jine,2);
		 _this.parent().next().next().find(".cfsjje").val(jine);
		 
		//总额
		var ze = $("#cfcash").val();
		//计算总额
     var jine2 = (ze * 1) - (zq * 1) + (money * 1);
		//保留2位小数点
     jine2 = decimal(jine2, 2);
     $("#cfcash").val(jine2);
		
		//实收金额
		var ss = $("#cfshje").val();
		//计算实收总额
		var ssResult = (ss*1)-(zq*1)+(money*1);
		//保留2位小数点
		ssResult = decimal(ssResult,2);
		$("#cfshje").val(ssResult);

     //获取应收金额
     var cardMoney = _this.parent().prev().find(".cfysje").val();
     if (jine > cardMoney) {
         alert("实收金额大于应收金额");
     }
 }
 
//刷卡计算
 function cfcard2 (_this) {
		//避免最后一个字符串是.
	 	_this.val((_this.val().replace(/\.$/g, "")));
	 	if(_this.val() == '-'){
			_this.val("")
		}
     //判断输入错误
     if (isNaN(Number(_this.val()))) {
         _this.val("")
     }
		 //现金
		 var money = _this.val()
		 if(money == ''){
			 money = 0;
		 }
		 //存放之前的值
		 var zq =  _this.next().val();
		 _this.next().val(money);
		 //实收金额
		 var ssje = _this.parent().next().find(".cfsjje").val();
		 //计算实收金额
		 var jine = (ssje*1)-(zq*1)+(money*1);
		//保留2位小数点
		jine = decimal(jine,2);
		_this.parent().next().find(".cfsjje").val(jine);
		
		
		//总额
		var ze = $("#cfcard").val();
		//计算总额
     var jine2 = (ze * 1) - (zq * 1) + (money * 1);
		//保留2位小数点
     jine2 = decimal(jine2, 2);
     $("#cfcard").val(jine2);
		
		//实收金额
		var ss = $("#cfshje").val();
		//计算实收总额
		var ssResult = (ss*1)-(zq*1)+(money*1);
		//保留2位小数点
		ssResult = decimal(ssResult,2);
		$("#cfshje").val(ssResult);

     //获取应收金额
     var cardMoney = _this.parent().prev().prev().find(".cfysje").val();
     if (jine > cardMoney) {
         alert("实收金额大于应收金额");
     }
 } 
 
 //点击单个学员
 function selSrtdent(_this){
	 var kemu = $(".kemu").val();
	 $.ajax({
		  url: '<%=path%>/DrivingSys/queryStuByPsql',
		  data:{'kemu':kemu},
         type: "post",
         dataType: "json",
         success:function(json){
       	  data(json)
       	 $(".loading").hide();
         },
         error: function () {
             alert('Error');
         }
	})
	 //获取当前对象序列
	 var ss = _this.parent().prev().find(".fseq").val();
	 $(".stu").val(ss);
	 $('#modal-overlay').css('visibility','visible')
	 $('.modal-data').css('visibility','visible')
	 $('.xysj input:checkbox').removeAttr('checked');
 }
//去除重复学员数据
function studentRepetition(oneStudent, muchStudent) {
    var a = true;
    if (oneStudent == null) {
        var strs = new Array(); //定义一数组
        strs = muchStudent.split(",");//转换成数组
        //循环添加的学员
        for (var i = 0; i < strs.length; i++) {
            //循环现有的学员
            $("input[name='cfstudentid']").each(function (j) {
                //判断添加的学员不能与现有的学员重复
                if (strs[i] == $(this).val()) {
                    a = false
                }
            })
        }
    } else {
        //循环现有的学员
        $("input[name='cfstudentid']").each(function (j) {
            //判断添加的学员不能与现有的学员重复
            if (oneStudent == $(this).val()) {
                a = false
            }
        })
    }
    return a;
}
 
//num是要处理的数字  v为要保留的小数位数
function decimal(num,v){
	var vv = Math.pow(10,v);
	return Math.round(num*vv)/vv;
}

//考试次数
function cfkscs2(_this) {
    //判断输入错误
    if (isNaN(Number(_this.val()))) {
        _this.val("")
    }
    if (parseInt(_this.val()) > 5) {
        alert("考试次数大于5次");
    }
}

//缺考次数
function cfqkcs2(_this) {
    //判断输入错误
    if (isNaN(Number(_this.val()))) {
        _this.val("")
    }
    if (parseInt(_this.val()) > 5) {
        alert("缺考次数大于5次");
    }
}

//当前加载计算总和
window.onload=function() {
	//计算现金
	var cfcash = 0;
	$(".cfcash").each(function(i){
		var s = $(this).val();
		cfcash = (cfcash*1) + (s*1);
		cfcash = decimal(cfcash,2);
	})
	$("#cfcash").val(cfcash)
	//计算刷卡
	var cfcard = 0;
	$(".cfcard").each(function(i){
		var s = $(this).val();
		cfcard = (cfcard*1) + (s*1);
		cfcard = decimal(cfcard,2);
	})
	$("#cfcard").val(cfcard)
	

	//计算应收金额
	var cfshje = 0;
	$(".cfysje").each(function(i){
		var s = $(this).val();
		cfshje = (cfshje*1) + (s*1);
		cfshje = decimal(cfshje,2);
	})
	$("#ysje").val(cfshje)
	
	//计算实收金额
	var cfsjje = 0;
	$(".cfsjje").each(function(i){
		var s = $(this).val();
		cfsjje = (cfsjje*1) + (s*1);
		cfsjje = decimal(cfsjje,2);
	})
	$("#cfshje").val(cfsjje)
}

//审核,反审核弹框
$("#sh,#fsh").click(function () {
    var type = $(this).next().val();
    $(".type").val(type)
    if (type == 1) {
        $('#modal-overlay').css('visibility', 'visible')
        $('.modal-data9').css('visibility', 'visible')
        $('li input:radio:first').attr('checked', 'checked');
    }
    else if (type == 2) {
        $('#modal-overlay').css('visibility', 'visible')
        $('.modal-data10').css('visibility', 'visible')
    }
})

//审核,反审核
$("#auditsubmit,#againstAuditsubmit").click(function () {
    //防止重复提交
    $(this).attr("disabled", "disabled")
    var state = $('li input[type="radio"]:checked ').val();//同意/不同意
    var fid = $(".fid").val();//fid
    var fnumber = $("input[name='fnumber']").val();//编码
    var type = $(".type").val();
    var message;
    if (type == '1') {
        message = $("#auditcomment").val();
    } else {
        message = $("#againstAuditcomment").val();
    }
    var studentName = new Array();
    var studentId = new Array();
    var cfstudentno = new Array();
    $(".studentName").each(function (i) {
        studentName[i] = $(this).val();
        studentId[i] = $(this).parent().next().find("input:hidden").val();
        cfstudentno[i] = $(this).parent().next().find(".cfstudentno").val();
    })
    $.ajax({
        url: '<%=path%>/DrivingSys/auditMakeupCharge',
        type: "post",
        data: {
            'fid': fid,
            'type': type,
            'fnumber': fnumber,
            'message': message,
            'state': state,
            'studentName': studentName,
            'studentId': studentId,
            'cfstudentno': cfstudentno
        },
        dataType: "json",
        success: function (json) {
            var url = '/queryMakeupCharge/look.action';
            if (type == '1') {
                if (json == '1') {
                    showAlert('审核成功,并且此流程已结束', url)
                } else if (json == '2') {
                    showAlert('审核成功', url)
                } else {
                    showAlert('审核失败', url)
                }
            } else {
                if (json == '1') {
                    showAlert('反审核成功', url)
                } else if (json == '2') {
                    showAlert('没有找到任务', url)
                } else if (json == '0') {
                    showAlert('找不到流程节点', url)
                }
            }
        },
        error: function () {
            $("#againstAuditsubmit,#auditsubmit").attr("disabled", false)//去除input元素的disabled属性
            alert('错误');
        }
    })
})
//提交
$("#submit").click(function () {
    $.messager.confirm('提示', '是否提交,提交后不会改变修改后的值', function (r) {
        if (r) {
            var url = '/queryMakeupCharge/look.action';
            var fid = $(".fid").val();
            var fnumber = $("input[name='fnumber']").val();
            var auditState = $("#auditState").val();
            var studentName = new Array();
            var studentId = new Array();
            var cfstudentno = new Array();
            $(".studentName").each(function (i) {
                studentName[i] = $(this).val();
                studentId[i] = $(this).parent().next().find("input:hidden").val();
                cfstudentno[i] = $(this).parent().next().find(".cfstudentno").val();
            })
            $.ajax({
                url: '<%=path%>/DrivingSys/submitMakeupCharge',
                type: "post",
                data: {
                    'fid': fid,
                    'fnumber': fnumber,
                    'auditState': auditState,
                    'studentName': studentName,
                    'studentId': studentId,
                    'cfstudentno': cfstudentno
                },
                dataType: "json",
                success: function (json) {
                    if (json == 1) {
                        showAlert('提交成功', url)
                    } else {
                        showAlert('提交失败', url)
                    }
                }
            })
        }
    })
})
//验证单据下是否有数据
function verify() {
    var s = 0;
    $("input[name='cfstudentid']").each(function () {
        if ($(this).val() == '' || $(this).val() == null) {
        } else {
            s = 1;
            return false;
        }

    })

    var ywrq = $("#ywrq").val();
    if (ywrq == null || ywrq == '') {
        alert("业务日期不能为空");
        return false;
    }

    if (s == 0) {
        alert("请至少添加一条数据");
        return false;
    }
    $("input[type='submit']").attr("disabled", "disabled");
}

//只读的属性不被修改
$('input[readonly]').on('focus', function () {
    $(this).trigger('blur');
});


$(document).ready(function(){
    var type = "${type}"
    if(type == null || type == ''){

    }else{
        editAlert();
    }
})
</script>
</html>